<?php
/* @var $this ExamController */
/* @var $model Exam */

?>



<?php 
for ($i=0;$i<sizeof($model);$i++) {
echo "<b>การสอบครั้งที่ ".($i+1)."</b><br>";	
$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model[$i],
	'attributes'=>array(
		array(
		'label'=>'วันที่สอบ',
		'value'=>DateTimeArray::convertMysqlToThaiDate($model[$i]->examDate)
	),
		'examTime',
		'examRoom',
		'floor',
	),
));
echo "<br>";
echo "คณะกรรมการสอบ";
for ($j=0;$j<sizeof($model[$i]->committees);$j++) {
	if ($model[$i]->committees[$j]->commitTypeID==1) {
		$user=UserAccount::model()->findByPk($model[$i]->committees[$j]->teacherID);
		$commitName=$user->prefix->prefix_name.$user->name." ".$user->surname;
	}else{
		$commitName=$model[$i]->committees[$j]->title.$model[$i]->committees[$j]->name;
	}
$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model[$i]->committees[$j],
	'attributes'=>array(
		array(
			'label'=>($j+1).'. ',
			'value'=>$commitName,
			),
	),
));
echo "<br />";
}
}
?>
